#include "InfoClient.h"



void InfoClient::SetInfoClientBase(string ip,string lastConnexion,int scenario, string etat ){
 
 Connexion con;
  con.initialisation();
  con.connect("avionage");
 
  string req("INSERT INTO `client` (`Ip` , `DerniereConnexion` , `ScenarioAttribue` , `Etat` ) VALUES (");
 
      Ip=ip;;
      DerniereConnexion=lastConnexion ;
 ScenarioAttribue=scenario; 
  char num[4];
  sprintf(num,"%d",ScenarioAttribue);
  string Scenario(num);
Etat=etat; 
   
  req=req+"'"+ip+"'"+","+"'"+DerniereConnexion+"'"+","+"'"+Scenario+"'"+","+"'"+etat+"'"+")";
  printf(" requete :%s\n",req.c_str());
  cout<< "num1"<<endl;
  mysql_query(con.get_con(),req.c_str());
  cout<<"num2"<<endl;
  con.closeConnexion(); 
   cout<<"num3"<<endl;
}
 



